package com.superteam.zzl.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;

import com.superteam.zzl.activity.databinding.ActivityInfoBinding;
import com.superteam.zzl.viewmodel.DynamicFragment.InfoPresenter;

public class InfoActivity extends AppCompatActivity implements View.OnClickListener {

    private ActivityInfoBinding db;
    private InfoPresenter presenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        db = DataBindingUtil.setContentView(this, R.layout.activity_info);
        presenter = new InfoPresenter(this, db);
        presenter.init();
        presenter.initView();
        String id = getData();
        if (id != null) {
            presenter.loadData(id);
        }
        setSupportActionBar(db.tl);
        db.tl.setNavigationOnClickListener(this);
    }

    private String getData() {
        return getIntent().getStringExtra("user_id");
    }

    @Override
    public void onClick(View v) {
        finish();
    }
}
